package com.xyhuo.leetcode.june;

/**
 * 172. 阶乘后的零
 * https://leetcode.cn/problems/factorial-trailing-zeroes/
 */
public class TrailingZeroes {

    public static void main(String[] args) {
        TrailingZeroes tz = new TrailingZeroes();
        tz.trailingZeroes(15);
    }

    public int trailingZeroes(int n) {
        if (n < 5) {
            return 0;
        }
        int ans = n / 5;
        return trailingZeroes(ans) + ans;
    }
}
